package thread;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Hua YY
 * Date: 2024-09-19
 * Time: 18:56
 */
public class ThreadDemon9 {
    public static void main(String[] args) {
        Thread t1 = new Thread(){
            @Override
            public void run() {
                while(true){
                    try {
                        Thread.sleep(1000);
                    } catch (InterruptedException e) {
                        throw new RuntimeException(e);
                    }
                    System.out.println("run线程方法正在执行");
                }
            }
        };
        //t1.run();//不屏蔽这行代码，将会一直死循环在run方法中，单线程main的
        t1.start();
        System.out.println("main函数线程正在执行");
    }

}
